package com.outdoor.exception;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 错误响应类
 * 
 * @author OutdoorTeam
 * @date 2025-05-18
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ErrorResponse {
    
    private boolean success;
    private String errorCode;
    private String message;
    private Long timestamp;
    
    /**
     * 创建错误响应
     * 
     * @param errorCode 错误代码
     * @param message 错误消息
     * @return 错误响应
     */
    public static ErrorResponse of(String errorCode, String message) {
        return ErrorResponse.builder()
                .success(false)
                .errorCode(errorCode)
                .message(message)
                .timestamp(System.currentTimeMillis())
                .build();
    }
} 